<?php

namespace App\Console\Commands;

use App\Common\Utils\EasyWechat;
use Illuminate\Console\Command;

class GetBatchgetMaterial extends Command
{
    /**
     * 命令名称及签名
     *
     * @var string
     */
    protected $signature = 'utils:get_batchget_material {conds*}';

    /**
     * 命令描述
     *
     * @var string
     */
    protected $description = '获取永久素材库列表';

    public function handle()
    {
        $argument = $this->argument('conds');

        $application = EasyWechat::getOfficialAccount();
        $this->output->text(json_encode((array) $application->material->list(
            $argument[0], // type
            $argument[1], // offset
            $argument[2], // count
        )));
    }
}
